<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 复杂数据类型传参
        function Hero(name) {
            this.name = name;
        }
        function change(x) {
            console.log(x.name);//  2.未赋值前的存储 虞姬
            x.name = "貂蝉";
            console.log(x.name);//3. 存储后的  貂蝉
        }
        var yuji = new Hero("虞姬");
        console.log(yuji.name);// 1new 后面的 虞姬
        change(yuji);
        console.log(yuji.name);// 4. 貂蝉
    </script>
</body>

</html>